<%--
    Document   : consultausuarios
    Created on : 10-jun-2010, 21:20:17
    Author     : WILLY C4
--%>

<%@ page import="java.util.Vector,com.db.trx.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <style type="text/css">
        body
        {
        background-color:#CCCCCC;
        font:10px Verdana, Arial, Helvetica, sans-serif;
        }
        </style>
    </head>
    <body>
        <h1>Lista de Usuarios</h1>
        <a href="indexusuariosistema.jsp">Menu Principal</a>
        <hr color="#CCCCCC">
        <table border="1" bgcolor="#87a6cd">
            <thead>
                <tr>
                    <th>Codigo</th>
                    <th>Nombre</th>
                    <th>Usuario</th>
                    <th>Editar</th>
                    <th>Eliminar</th>
                </tr>
            </thead>
            <tbody>
            <%
            Vector alumnos = Sql.consulta("select * from Customer ");
            for(int fils=1; fils<alumnos.size(); ++fils) {
            String[] unaFila= (String[]) alumnos.get(fils);
            %>
            <tr>
                <td align="center"><%=unaFila[0]%></td>
                <td align="center"><%=unaFila[1]%></td>
                <td align="center"><%=unaFila[2]%></td>
                <td align="center"><a href='registrousuario.jsp?codigo=<%=unaFila[0]%>'>Editar</a></td>
                <td align="center"><a onclick="javascript:return confirm('Seguro que desea eliminar el registro?')" href='../eliminarusuariosistema?codigo=<%=unaFila[0]%>'>Eliminar</a></td>
            </tr>
            <% } %>
            <form method="post" action="../insertarusuariosistema">
            <tr>
                <td align="center">Nuevo</td>
                <td align="center"><input type="text" name="txtnombre" value="" size="20" /></td>
                <td align="center"><input type="text" name="txtusuario" value="" size="20" /></td>
                <td align="center">Clave:<input type="password" name="txtclave" value="" size="20" /></td>
                <td align="center"><input type="submit" value="Registrar" name="btnregistrar" /></td>
            </tr>
            </form>
            </tbody>
        </table>
    </body>
    <% if (request.getParameter("msj")!=null)
    {
        out.println("<SCRIPT LANGUAGE='javascript'>alert('"+request.getParameter("msj")+"');</SCRIPT>");
    }
    %>
</html>
